package com.fyzk.activity.lottery.jc.beidan;

import com.fyzk.utils.LotteryIDUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by fanxs11 on 2017/11/22.
 */

public class BeiDan_BQC_PayActivity extends BeiDanBasePayActivity {

    @Override
    protected void onResume() {
        super.onResume();
    }

    @Override
    protected BeiDanBasePayAdapter getAdapter() {
        return new BeiDan_BQC_PayAdapter(getContext(), pay_infors, this);
    }

    @Override
    public int getLotteryId() {
        return LotteryIDUtils.DCBQC_LOTTERY_ID_INT;
    }

    @Override
    public String getBetCode() {
        List<String> chuans = new ArrayList<>();
        for (int i = 0; i < guoGuanTypes.size(); i++) {
            if (guoGuanTypes.get(i).isCheck) {
                chuans.add(guoGuanTypes.get(i).typeId);
            }
        }
//        if (getZhushu() > 1) {
//            wanFa = 2;
//        } else {
//            wanFa = 1;
//        }
        wanFa = 1;
        String content = "";
        for (int i = 0; i < chuans.size(); i++) {
            lotteryId = getLotteryId();
            content += lotteryId + "" + wanFa + chuans.get(i) + "-";// 301012001-
            String n = "";
            String danCodes = "";
            for (int j = 0; j < pay_infors.size(); j++) {
                BeiDanChildBean info = pay_infors.get(j);
                String danChang = "";
                if (info.checkNum != 0) {
                    danChang = info.getMatchNum() + "(";
                    if (info.isBqc_33) {
                        danChang += "33,";
                    }
                    if (info.isBqc_31) {
                        danChang += "31,";
                    }
                    if (info.isBqc_30) {
                        danChang += "30,";
                    }

                    if (info.isBqc_13) {
                        danChang += "13,";
                    }
                    if (info.isBqc_11) {
                        danChang += "11,";
                    }
                    if (info.isBqc_10) {
                        danChang += "10,";
                    }

                    if (info.isBqc_03) {
                        danChang += "03,";
                    }
                    if (info.isBqc_01) {
                        danChang += "01,";
                    }
                    if (info.isBqc_00) {
                        danChang += "00,";
                    }

                    danChang = danChang.substring(0, danChang.length() - 1);
                    danChang += ")";
                }
                if (!danChang.equals("")) {
                    if (info.isDan) {
                        danCodes += danChang + "|";
                    } else {
                        n += danChang + "|";
                    }
                }
            }
            if (!danCodes.equals("")) {
                danCodes = danCodes.substring(0, danCodes.length() - 1);
                danCodes += "#";
            }
            if (!n.equals("")) {
                n = n.substring(0, n.length() - 1);
                n += "^";
            }
            content += danCodes + n + "!";
        }
        if (!content.equals("")) {
            content = content.substring(0, content.length() - 1);
        }
        return content;
    }

    @Override
    protected int maxChuanCount() {
        return 6;
    }
}
